home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / omniORB-2.5.0-src.tar.gz / omniORB-2.5.0-src.tar / omniORB_2.5.0 / include / omniORB2 / CORBA_sysdep.h < prev    next >
C/C++ Source or Header  |  1998-01-20  |  6KB  |  236 lines

  1. // -*- Mode: C++; -*-
  2. //                            Package   : omniORB2
  3. // CORBA_sysdep.h             Created on: 30/1/96
  4. //                            Author    : Sai Lai Lo (sll)
  5. //
  6. //    Copyright (C) 1996, 1997 Olivetti & Oracle Research Laboratory
  7. //
  8. //    This file is part of the omniORB library
  9. //
  10. //    The omniORB library is free software; you can redistribute it and/or
  11. //    modify it under the terms of the GNU Library General Public
  12. //    License as published by the Free Software Foundation; either
  13. //    version 2 of the License, or (at your option) any later version.
  14. //
  15. //    This library is distributed in the hope that it will be useful,
  16. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. //    Library General Public License for more details.
  19. //
  20. //    You should have received a copy of the GNU Library General Public
  21. //    License along with this library; if not, write to the Free
  22. //    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
  23. //    02111-1307, USA
  24. //
  25. //
  26. // Description:
  27. //    *** PROPRIETORY INTERFACE ***
  28. //
  29. //     Define a set of flags in C++ macros. These flags provide information
  30. //      about the system and the compiler used.
  31. // 
  32.  
  33. /*
  34.  $Log: CORBA_sysdep.h,v $
  35.  * Revision 1.14  1998/01/20  16:45:57  sll
  36.  * Added support for OpenVMS.
  37.  *
  38.  Revision 1.13  1997/12/09 20:40:21  sll
  39.  Various platform specific updates.
  40.  
  41.  Revision 1.12  1997/08/21 22:22:12  sll
  42.  Support for AIX.
  43.  
  44.  * Revision 1.11  1997/07/21  17:07:38  tjr
  45.  * use new OS / processor macros
  46.  *
  47.  * Revision 1.10  1997/05/06  16:06:03  sll
  48.  * Public release.
  49.  *
  50. */
  51.  
  52. #ifndef __CORBA_SYSDEP_H__
  53. #define __CORBA_SYSDEP_H__
  54.  
  55.  
  56. #if defined(__GNUG__)
  57. // GNU G++ compiler
  58.  
  59. #  if defined(__alpha) && !defined(__VMS)
  60. #     define SIZEOF_LONG 8
  61. #     define SIZEOF_INT  4
  62. #     define SIZEOF_PTR  8
  63. #  endif
  64.  
  65. #elif defined(__DECCXX)
  66. // DEC C++ compiler
  67. #define NEED_DUMMY_RETURN
  68.  
  69. #  if defined(__alpha) && !defined(__VMS)
  70. #     define SIZEOF_LONG 8
  71. #     define SIZEOF_INT  4
  72. #     define SIZEOF_PTR  8
  73. #  endif
  74.  
  75. #elif defined(__SUNPRO_CC) 
  76. // SUN C++ compiler
  77. #if __SUNPRO_CC < 0x420
  78. #define NEED_DUMMY_RETURN
  79. #endif
  80.  
  81. #elif defined(_MSC_VER)
  82. //  Microsoft Visual C++ compiler
  83. #define NEED_DUMMY_RETURN
  84. #endif
  85.  
  86. #if defined(__hpux__)
  87. // HP aCC does not define a macro to identify itself.
  88. // Test if this is gcc, if not assume it is aCC.
  89. #if !defined(__GNUG__)
  90. #define NEED_DUMMY_RETURN
  91. #endif
  92.  
  93. // Do we really need to include this here?   -SLL
  94. #include <stdio.h>
  95. #undef __ptr
  96.  
  97. #endif
  98.  
  99.  
  100. #if defined(arm)
  101. // We don't have support for float.
  102. #   define NO_FLOAT
  103. #endif
  104.  
  105. #ifndef __cplusplus
  106. #error "Cannot use this C++ header file for non C++ programs."
  107. #endif
  108.  
  109. #ifdef Status
  110. #error "Name conflict: Status is defined as a macro in a header file include before this."
  111. // X11's Xlib.h (and may be others) define Status as a macro. This name
  112. // conflicts with the Status type defined in the CORBA namespace.
  113. // To remove this error, make sure that the offending header file is included
  114. // after omniORB2/CORBA.h.
  115. #endif
  116.  
  117.  
  118. // Default flag values if not already overridden above
  119.  
  120. #ifndef SIZEOF_LONG
  121. #define SIZEOF_LONG 4
  122. #endif
  123.  
  124. #ifndef SIZEOF_INT
  125. #define SIZEOF_INT 4
  126. #endif
  127.  
  128. #ifndef SIZEOF_PTR
  129. #define SIZEOF_PTR  4
  130. #endif
  131.  
  132. #ifndef _CORBA_MODULE
  133. #define _CORBA_MODULE class
  134. #endif
  135.  
  136. #ifndef _CORBA_MODULE_PUBLIC
  137. #define _CORBA_MODULE_PUBLIC public:
  138. #endif
  139.  
  140. #if defined(__arm__) && defined(__atmos__)
  141. #define _OMNIORB_HOST_BYTE_ORDER_ 1
  142. #elif defined(__alpha__) && !defined(__VMS)
  143. #define _OMNIORB_HOST_BYTE_ORDER_ 1
  144. #define _HAS_SIGNAL 1
  145. #elif defined(__sunos__) && defined(__sparc__)
  146. #define _OMNIORB_HOST_BYTE_ORDER_ 0
  147. #define _HAS_SIGNAL 1
  148. #if __OSVERSION__ == 5
  149. #define NEED_GETHOSTNAME_PROTOTYPE
  150. #endif
  151. #elif defined(__x86__)
  152. #define _OMNIORB_HOST_BYTE_ORDER_ 1
  153. #if !defined(__WIN32__)
  154. #define _HAS_SIGNAL 1
  155. #endif
  156. #elif defined(__aix__) && defined(__powerpc__)
  157. #define _OMNIORB_HOST_BYTE_ORDER_ 0
  158. #define _HAS_SIGNAL 1
  159. #elif defined(__hpux__) && defined(__hppa__)
  160. #define _OMNIORB_HOST_BYTE_ORDER_ 0
  161. #define _HAS_SIGNAL 1
  162. #elif defined(__m68k__) && defined(__nextstep__)
  163. #define _OMNIORB_HOST_BYTE_ORDER_ 0
  164. #define _HAS_SIGNAL 1
  165. #define _USE_MACH_SIGNAL 1
  166. #define _NO_STRDUP 1
  167. #define _USE_GETHOSTNAME 1
  168. #elif defined(__VMS)
  169. #define _OMNIORB_HOST_BYTE_ORDER_ 1
  170. #if __VMS_VER >= 70000000
  171. #define _HAS_SIGNAL 1
  172. #else
  173. #include <string.h>
  174. // Pre 7.x VMS does not have strdup.
  175. inline static char *
  176. strdup (char* str)
  177. {
  178.   char *newstr;
  179.  
  180.   newstr = (char *) malloc (strlen (str) + 1);
  181.   if (newstr)
  182.     strcpy (newstr, str);
  183.     return newstr;
  184. }
  185. #endif
  186. #else
  187. #error "The byte order of this platform is unknown"
  188. #endif
  189.  
  190.  
  191. // Define macro for NT DLL import/export:
  192. // Note that if an application is being compiled (using MSVC++ on NT or '95) 
  193. // to use the static library, the macro _WINSTATIC should be defined.
  194.  
  195. #if defined(__WIN32__) && defined(_MSC_VER)
  196.  
  197. #if defined(_OMNIORB2_DLL) && defined(_WINSTATIC)
  198. #error "Both _OMNIORB2_DLL and _WINSTATIC are defined."
  199. #elif defined(_OMNIORB2_DLL)
  200. #define _OMNIORB2_NTDLL_ __declspec(dllexport) 
  201. #pragma warning(disable: 4251)
  202. // Disable this warning, as myPrincipalID is defined by a template, which
  203. // can't be exported using __declspec
  204. #elif !defined(_WINSTATIC)
  205. #define _OMNIORB2_NTDLL_ __declspec(dllimport)
  206. #pragma warning(disable: 4251)
  207. // Disable this warning, as myPrincipalID is defined by a template, which
  208. // can't be imported using __declspec
  209. #elif defined(_WINSTATIC)
  210. #define _OMNIORB2_NTDLL_
  211. #endif 
  212.  // _OMNIORB2_DLL && _WINSTATIC
  213.  
  214. #ifdef _DEBUG
  215. // The type name instantiated from the sequence templates could exceeds the
  216. // 255 char limit of the debug symbol names. It is harmless except that one
  217. // cannot read their values with the debugger. Disable the warning about
  218. // the symbol name truncation.
  219. #pragma warning(disable: 4786)
  220. #endif
  221.  
  222. #else
  223. #define _OMNIORB2_NTDLL_
  224. #endif
  225.    // __WIN32__ && _MSC_VER
  226.  
  227. // This implementation *DOES NOT* support the Dynamic Invocation Interface
  228. // and the Dynamic Skeleton Interface. Hence some of the psuedo objects are
  229. // not or only partially implemented. The declaration of the unimplemented
  230. // classes and member functions are excluded by absence of the following
  231. // macro. Uncomment the following line to make these declarations visible.
  232.  
  233. //#define SUPPORT_DII
  234.  
  235. #endif // __CORBA_SYSDEP_H__
  236.